fix(core): [Session based Traces for Mobile 1] Keep spanless baggage mutable#5384
Draft
adinauer wants to merge 2 commits intofeat/session-based-traces-mobilefrom
Draft
Conversation
Only freeze scope baggage during spanless propagation when it carries incoming Sentry DSC values that should be protected. This keeps local propagation baggage writable for a later transaction so transaction-specific DSC can be emitted. Co-Authored-By: Claude <[email protected]>
Member
Author
|
@sentry review |
Member
Author
|
cursor review |
📲 Install BuildsAndroid
|
|
|
||
| ### Fixes | ||
|
|
||
| - Fix transaction-specific dynamic sampling context fields missing after earlier spanless outgoing requests ([#5384](https://github.com/getsentry/sentry-java/pull/5384)) |
Contributor
There was a problem hiding this comment.
- 🚫 The changelog entry seems to be part of an already released section
## 8.41.0.
Consider moving the entry to the## Unreleasedsection, please.
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit 7cce069. Configure here.
Contributor
Performance metrics 🚀
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PR Stack (Session based Traces for Mobile)
📜 Description
Keeps local scope baggage mutable after spanless trace propagation.
TracingUtils.maybeUpdateBaggagenow freezes baggage only when it was marked asshouldFreeze, which protects incoming Sentry DSC without finalizing local propagation baggage.Adds regression coverage for the spanless-before-transaction sequence to ensure a later transaction can still write
sentry-transaction,sentry-sampled, andsentry-sample_rateinto outgoing DSC.💡 Motivation and Context
For session-based traces on mobile, an outgoing request can happen before an Activity or navigation transaction starts. Previously, that spanless request froze local scope baggage, and a later transaction could inherit frozen baggage and miss transaction-specific DSC fields.
This keeps incoming/fixed DSC protected while allowing local session trace baggage to be completed by the eventual transaction.
💚 How did you test it?
./gradlew spotlessApply apiDump./gradlew :sentry:test --tests io.sentry.util.TracingUtilsTest📝 Checklist
sendDefaultPIIis enabled.🔮 Next steps
Continue the Session based Traces for Mobile stack.